<?php

namespace App\Controller\App;

use App\Base\BaseController4Restful;
use App\Repository\ConfigRepository;
use App\Repository\TaskRepository;
use App\Service\TaskService;
use Symfony\Component\Routing\Annotation\Route;

/**
 * @route("/app")
 */
class TaskController extends BaseController4Restful
{
    /**
     * @Route("/tasks", name="appTaskGetAll",methods={"GET"})
     */
    public function appTaskGetAll(TaskRepository $repository,TaskService $taskService)
    {//公开列表的获取

//        $rst = myExplodeNumbers("1,2,3,4");
//        $repository->find(107);
        $rst = $taskService->dealWithTaskCreate($repository->find(107));
return;
        dd($rst);

        $taskService->getPublicList(37.412543,118.661927,1,100);


//        if (!$page = $this->getParamRequired("page")) {$page = 1;}
//        $qb = $repository->createQueryBuilder("A");
//        $qb->select("A")
//            ->join("App:UserAddress","B","with","A.address = B");
//        $qb->where("A.type = 1");
//        $qb->orderBy("A.createAt","DESC");
//        $qb->setMaxResults(10);
//        $qb->setFirstResult($page * 10 -10);
//        $data = $qb->getQuery()->execute();
//
//        $this->setGroups("task");
//        return $this->json_out(200,"ok",$data);
    }
}
